import request from "@/utils/request";

/**  文书代写分页查询参数 */
export interface InstrumentQuery {
  current?: number;
  pageSize?: number;
  instrumentName?: string;
  instrumentCategory?: string;
  instrumentTypeId?: number;
}

/** 文书代写分页对象 */
export interface InstrumentVO {
  current: number;
  pages: number;
  records: any;
  size: number;
  total: number;
}
/** 文书代写表单 */
export interface InstrumentForm {
  instrumentTypeId?: number;
  instrumentTypeName?: string;
  instrumentCategory?: number;
  instrumentCategoryName?: string;
  expenses?: number;
  expensesUnit?: string;
  instrumentName?: string;
  instrumentDetail?: string;
  instrumentFileUrl?: string;
  soldTimes?: number;
  instrumentImgUrl?: string;
  businessCategoryId?: number;
  businessCategoryName?: string;
  newBusinessCategoryName?: string;
  lawyerList?: any;
  id?: number;
  newInstrumentImgUrl?: any;
  isUpload?: boolean;
}
class instrumentAPI {
  /** 获取文书代写列表 */
  static getInstrument(params: InstrumentQuery) {
    return request<any, InstrumentVO>({
      url: "/api/instrument/getPage",
      method: "post",
      data: params,
    });
  }
  /** 新增+修改 文书代写列表 */
  static updateInstrument(params: InstrumentForm) {
    return request({
      url: "/api/instrument",
      method: "post",
      data: params,
    });
  }
  /** 删除文书代写列表 */
  static deleteInstrument(ids: string) {
    return request({
      url: `/api/instrument/deleteBatch?ids=${ids}`,
      method: "delete",
      // data: params,
    });
  }
}

export default instrumentAPI;
